/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FrameWork.Objects.Items;

import FrameWork.GameScreen;
import FrameWork.Objects.Character.Player;
import FrameWork.Objects.MyObject;
import GamePlay.Global;
import javax.microedition.lcdui.Graphics;

/**
 *
 * @author ThanhTri
 */
public class Door extends Items{
    public Door(int _X,int _Y, int _SizeX, int _SizeY,
            float _TimeAni, 
            int _Map[][],int _Width, int _Height,
            int _ID){     
        super(_X, _Y, _SizeX, _SizeY, _TimeAni, _Map, _Width, _Height, _ID);
        m_CurFrame = 1;
    }
    public void ActionCollision (MyObject _Object){
    }   
    public void UpdateAnimation (float _Time){
        m_SaveTimeAni += _Time;
        
        switch(m_STATUS){
            case Global.STT_ACTIVE:
                m_CurFrame = 1;
                break;
            case Global.STT_DEATH:
                m_CurFrame = 2;
                break;
        }
    }
    public void DrawScreen (Graphics _Graphics,GameScreen _Screen){
        switch(m_STATUS){
            case Global.STT_ACTIVE:
            case Global.STT_DEATH:
                super.DrawScreen(_Graphics, _Screen);
        }
    }
    public void Active (Player _Player){
        if(m_STATUS == Global.STT_ACTIVE)
            if(_Player.m_iKey == true){
                _Player.m_iKey = false;
                m_CurFrame = 6;
                m_STATUS = Global.STT_DEATH;
            }
    }
}
